package com.cn.serverline.lineicp.workshopPlan.controller;

import cn.stylefeng.roses.kernel.rule.pojo.response.ResponseData;
import cn.stylefeng.roses.kernel.rule.pojo.response.SuccessResponseData;
import cn.stylefeng.roses.kernel.scanner.api.annotation.ApiResource;
import cn.stylefeng.roses.kernel.scanner.api.annotation.GetResource;
import com.cn.serverline.lineicp.workshopPlan.entity.request.WeekStageDaysTasksRequest;
import com.cn.serverline.lineicp.workshopPlan.entity.request.WeeklyTimeRequest;
import com.cn.serverline.lineicp.workshopPlan.service.WeekStageDaysTasksService;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;


/**
 * 车间下发周计划任务明细 接口
 *
 * @author 田江余
 * @since 2024年8月7日
 */

@RestController
@ApiResource(name = "车间下发周计划任务明细的接口")
public class WeekStageDaysTasksController {

    @Resource(name = "PlanWeekStageDaysTasksServiceImpl")
    private WeekStageDaysTasksService weekStageDaysTasksService;

    /**
     * 车间下发周计划任务明细列表查询
     * @param planWeekStageDaysTasksVo 请求参数
     * @return 返回数据列表
     */
    @GetResource(name = "车间下发周计划任务明细列表查询", path = "/planWeekStageDaysTasks/findList")
    public ResponseData<HashMap<String,Object>> findList(WeekStageDaysTasksRequest planWeekStageDaysTasksVo) {
        return new SuccessResponseData<>(weekStageDaysTasksService.findList(planWeekStageDaysTasksVo));
    }

    /**
     * 查询每周数量
     * @param planWeekStageDaysTasksVo 请求参数
     * @return 返回数据列表
     */
    @GetResource(name = "查询每周数量", path = "/planWeekStageDaysTasks/findWeek")
    public ResponseData<List<WeeklyTimeRequest>> findWeek(WeekStageDaysTasksRequest planWeekStageDaysTasksVo) {
        return new SuccessResponseData<>(weekStageDaysTasksService.findWeek(planWeekStageDaysTasksVo));
    }
}
